package com.ting.encrypt.config;

import com.ting.encrypt.annotation.EncryptField;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * @author: guohaibing
 * @date: 2022/9/30 11:33
 * @description: 该类用于存放配置信息 或者通用数据
 */
public class EncryptConfig {
  /** 加密算法配置信息 */
  private static ConcurrentHashMap<String, String> encryptMap = new ConcurrentHashMap();

  /** 加密表信息，key是表明，value中的key是表中的字段名，value是字段的加密方式 */
  private static ConcurrentHashMap<String, Map<String, EncryptField>> encryptTableInfoMap =
      new ConcurrentHashMap();

  public static void setMap(String key, String value) {
    encryptMap.put(key, value);
  }

  public static String getValue(String key) {
    return encryptMap.get(key);
  }

  public static Map<String, EncryptField> getEncryptTableInfoMap(String key) {
    return encryptTableInfoMap.get(key);
  }

  public static void setEncryptTableInfoMap(String key, Map<String, EncryptField> value) {
    encryptTableInfoMap.put(key, value);
  }
}